﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace kongjian16
{
    [Designer(typeof(TongJi_EMS._TJ_Basic.TJ_BasicControlDesigner))]
    public partial class jiedi10KV : TongJi_EMS._TJ_Basic.TJ_BasicControl
    {
        public jiedi10KV()
        {
            InitializeComponent();
            this.NeedPoint = true;
        }
        private string bol = "1";
        [CategoryAttribute("Data")]
        [Description("接地刀闸开合信号，0为打开状态，1为闭合状态")]
        public string Bol
        {
            get { return bol; }
            set { bol = value; }


        }
        private string faultSignal = "0";//故障信号
        [CategoryAttribute("Data")]
        [Description("变压器故障信号，0为正常状态，1为故障状态")]
        public string FaultSignal
        {
            get { return faultSignal; }
            set { faultSignal = value; }

        }
        private void jiedidaoza_Paint(object sender, PaintEventArgs e)
        {

            Pen a = new Pen(CtrColor, 1);
            e.Graphics.DrawLine(a, x, 0, x, y * 2f / 3f);
            e.Graphics.DrawLine(a, x * 0.7f, y * 2f / 3f, x * 1.3f, y * 2f / 3f);
            e.Graphics.DrawLine(a, x, y*1.1f, x, y * 5.2f / 3f);
            e.Graphics.DrawLine(a, x * 0.3f, y * 5.2f / 3f, x * 1.7f, y * 5.2f / 3f);
            e.Graphics.DrawLine(a, x * 0.45f, y * 5.45f / 3f, x * 1.55f, y * 5.45f / 3f);
            e.Graphics.DrawLine(a, x * 0.6f, y * 5.65f / 3f, x * 1.4f, y * 5.65f / 3f);
            if (bol=="0")
            {
                Pen v = new Pen(Color.Green,1);
                e.Graphics.DrawLine(v, x, y * 1.1f, x * 0.2f, y * 1.8f / 3f); }
            if(bol=="1")
            {
                e.Graphics.DrawLine(a, x, y * 1.1f, x * 0.7f, y * 1.8f / 3f);
            }

            Pen c = new Pen(Color.White, 3);
            if (faultSignal == "1")
            {

                e.Graphics.DrawRectangle(c, x * 0.1f, y * 0.1f, x * 1.8f, y * 1.8f);

            }

        }

        private void jiedidaoza_Resize(object sender, EventArgs e)
        {
            this.x = this.Width / 2;
            this.y = this.Height / 2;
            //this.Refresh();

        }

        private void jiedidaoza_Load(object sender, EventArgs e)
        {
            jiedidaoza_Resize(sender, e);
        }




    }
}